<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <title>title</title>
    <style>
        div {
            height: 200px;
            width: 400px;
            display: inline-block;
        }
        
        .box1 {
            background-color: red;
            border: 5px solid black;
        }
        
        .box2 {
            background-color: yellow;
            border: 5px solid blue;
        }
    </style>
</head>


<body>
    <div class="box1">盒子1</div>
    <div class="box2">盒子2</div>
    <!-- 如果不使用浮动布局,盒子和盒子中间会有间隔 -->
</body>

</html>